package top.resty.erp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.resty.erp.dao.IBrand;
import top.resty.erp.domain.Brand;
import top.resty.erp.service.BrandService;

import java.util.List;

/**
 * <pre>
 *
 * </pre>
 *
 * @author : resty
 * @date : 2021年03月21 16:50
 */
@Service
public class BrandServiceImpl implements BrandService {
	
	@Autowired
	private IBrand iBrand;
	
	@Override
	public List<Brand> getBrands(String searchName) {
		return iBrand.getBrands(searchName);
	}
	
	@Override
	public List<Brand> getAllBrands() {
		return iBrand.getAllBrands();
	}
	
	@Override
	public boolean updateBrand(String keyStr, String valueStr, Integer id) {
		return iBrand.updateBrand(keyStr, valueStr, id)==1?true:false;
	}
	
	@Override
	public boolean delete(int id) {
		if(iBrand.delete(id)==1){
			return true;
		}
		return false;
	}
	
	@Override
	public boolean saveBrand(String name) {
		return iBrand.saveBrand(name)==1?true:false;
	}
}
